package com.ruoyi.wechat.service.impl;

import java.util.List;

import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.wechat.mapper.ActivityMapper;
import com.ruoyi.wechat.domain.Activity;
import com.ruoyi.wechat.service.IActivityService;

/**
 * 营地活动表Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-10-29
 */
@Service
public class ActivityServiceImpl implements IActivityService 
{
    @Autowired
    private ActivityMapper activityMapper;

    /**
     * 查询营地活动表
     * 
     * @param activityId 营地活动表主键
     * @return 营地活动表
     */
    @Override
    public Activity selectActivityByActivityId(String activityId)
    {
        return activityMapper.selectActivityByActivityId(activityId);
    }
    @Override
    public Activity selectActivityBycampId(String campId)
    {
        return activityMapper.selectActivityBycampId(campId);
    }

    /**
     * 查询营地活动表列表
     * 
     * @param activity 营地活动表
     * @return 营地活动表
     */
    @Override
    public List<Activity> selectActivityList(Activity activity)
    {
        return activityMapper.selectActivityList(activity);
    }

    /**
     * 新增营地活动表
     * 
     * @param activity 营地活动表
     * @return 结果
     */
    @Override
    public String insertActivity(Activity activity)
    {
        activity.setActivityId(IdUtils.randomUUID());
        activityMapper.insertActivity(activity);
        return activity.getActivityId();
//        return activityMapper.insertActivity(activity);
    }

    /**
     * 修改营地活动表
     * 
     * @param activity 营地活动表
     * @return 结果
     */
    @Override
    public int updateActivity(Activity activity)
    {
        return activityMapper.updateActivity(activity);
    }

    /**
     * 批量删除营地活动表
     * 
     * @param activityIds 需要删除的营地活动表主键
     * @return 结果
     */
    @Override
    public int deleteActivityByActivityIds(String[] activityIds)
    {
        return activityMapper.deleteActivityByActivityIds(activityIds);
    }

    /**
     * 删除营地活动表信息
     * 
     * @param activityId 营地活动表主键
     * @return 结果
     */
    @Override
    public int deleteActivityByActivityId(String activityId)
    {
        return activityMapper.deleteActivityByActivityId(activityId);
    }
}
